package com.happystreet.config
{
	/**
	 *材料配置文件 ->materials.xml
	 * @author Liseen
	 * 
	 */	
	public class MaterialsConfig
	{
		public static var materialsConfig:XML;
		public function MaterialsConfig()
		{
			throw new Error("PartsConfig: this class can't be instantiated.");
		}
		/**
		 *通过材料ID获取元件名 
		 * @param material_id
		 * @return 
		 * 
		 */		
		public static function getMaterialSymbolNameById(material_id:int):String
		{
			return String(materialsConfig..material.(@id == material_id).@symbol);
		}
		/**
		 * 设置材料配置
		 * @param data
		 * 
		 */		
		public static function setMaterialsConfig(data:String):void
		{
			materialsConfig = new XML(data);
		}
		
		/**
		 *通过ID获取材料名称
		 * @param material_id
		 * @return 
		 * 
		 */		
		public static function getMaterialNameById(material_id:int):String
		{
			return String(materialsConfig..material.(@id == material_id).@name);
		}
	}
}